<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: QCPMarginGroup Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="class_q_c_p_margin_group-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QCPMarginGroup Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A margin group allows synchronization of margin sides if working with multiple layout elements.  
 <a href="class_q_c_p_margin_group.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for QCPMarginGroup:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_q_c_p_margin_group.png" usemap="#QCPMarginGroup_map" alt=""/>
  <map id="QCPMarginGroup_map" name="QCPMarginGroup_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac481c20678ec5b305d6df330715f4b7b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_margin_group.html#ac481c20678ec5b305d6df330715f4b7b">QCPMarginGroup</a> (<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *parentPlot)</td></tr>
<tr class="separator:ac481c20678ec5b305d6df330715f4b7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac967a4dc5fe02ae44aeb43511d5e1bd4"><td class="memItemLeft" align="right" valign="top">QList&lt; <a class="el" href="class_q_c_p_layout_element.html">QCPLayoutElement</a> * &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_margin_group.html#ac967a4dc5fe02ae44aeb43511d5e1bd4">elements</a> (<a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a> side) const</td></tr>
<tr class="separator:ac967a4dc5fe02ae44aeb43511d5e1bd4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0d32656d8a5fc5690c4e7693f9d0539"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_margin_group.html#ae0d32656d8a5fc5690c4e7693f9d0539">isEmpty</a> () const</td></tr>
<tr class="separator:ae0d32656d8a5fc5690c4e7693f9d0539"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a144b67f216e4e86c3a3a309e850285fe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_margin_group.html#a144b67f216e4e86c3a3a309e850285fe">clear</a> ()</td></tr>
<tr class="separator:a144b67f216e4e86c3a3a309e850285fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:aea6a00373b3a0305de56c34d2423ea99"><td class="memItemLeft" align="right" valign="top"><a id="aea6a00373b3a0305de56c34d2423ea99"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>commonMargin</b> (<a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a> side) const</td></tr>
<tr class="separator:aea6a00373b3a0305de56c34d2423ea99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb9c3a35acec655c2895b7eb95ee0524"><td class="memItemLeft" align="right" valign="top"><a id="acb9c3a35acec655c2895b7eb95ee0524"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>addChild</b> (<a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a> side, <a class="el" href="class_q_c_p_layout_element.html">QCPLayoutElement</a> *element)</td></tr>
<tr class="separator:acb9c3a35acec655c2895b7eb95ee0524"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20ab3286062957d99b58db683fe725b0"><td class="memItemLeft" align="right" valign="top"><a id="a20ab3286062957d99b58db683fe725b0"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>removeChild</b> (<a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a> side, <a class="el" href="class_q_c_p_layout_element.html">QCPLayoutElement</a> *element)</td></tr>
<tr class="separator:a20ab3286062957d99b58db683fe725b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a23cfa29e3cc0f33a59141b77d8c04edf"><td class="memItemLeft" align="right" valign="top"><a id="a23cfa29e3cc0f33a59141b77d8c04edf"></a>
<a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>mParentPlot</b></td></tr>
<tr class="separator:a23cfa29e3cc0f33a59141b77d8c04edf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a954bc89ff8958b9bb6a4a0d08ed5fc0f"><td class="memItemLeft" align="right" valign="top"><a id="a954bc89ff8958b9bb6a4a0d08ed5fc0f"></a>
QHash&lt; <a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a>, QList&lt; <a class="el" href="class_q_c_p_layout_element.html">QCPLayoutElement</a> * &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mChildren</b></td></tr>
<tr class="separator:a954bc89ff8958b9bb6a4a0d08ed5fc0f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a0790750c7e7f14fdbd960d172655b42b"><td class="memItemLeft" align="right" valign="top"><a id="a0790750c7e7f14fdbd960d172655b42b"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>QCPLayoutElement</b></td></tr>
<tr class="separator:a0790750c7e7f14fdbd960d172655b42b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A margin group allows synchronization of margin sides if working with multiple layout elements. </p>
<p><a class="el" href="class_q_c_p_margin_group.html" title="A margin group allows synchronization of margin sides if working with multiple layout elements...">QCPMarginGroup</a> allows you to tie a margin side of two or more layout elements together, such that they will all have the same size, based on the largest required margin in the group.</p>
<p><br />
</p><div class="image">
<img src="QCPMarginGroup.png" alt="QCPMarginGroup.png"/>
<div class="caption">
Demonstration of QCPMarginGroup</div></div>
<p><br />
 In certain situations it is desirable that margins at specific sides are synchronized across layout elements. For example, if one <a class="el" href="class_q_c_p_axis_rect.html" title="Holds multiple axes and arranges them in a rectangular shape. ">QCPAxisRect</a> is below another one in a grid layout, it will provide a cleaner look to the user if the left and right margins of the two axis rects are of the same size. The left axis of the top axis rect will then be at the same horizontal position as the left axis of the lower axis rect, making them appear aligned. The same applies for the right axes. This is what <a class="el" href="class_q_c_p_margin_group.html" title="A margin group allows synchronization of margin sides if working with multiple layout elements...">QCPMarginGroup</a> makes possible.</p>
<p>To add/remove a specific side of a layout element to/from a margin group, use the <a class="el" href="class_q_c_p_layout_element.html#a516e56f76b6bc100e8e71d329866847d">QCPLayoutElement::setMarginGroup</a> method. To completely break apart the margin group, either call <a class="el" href="class_q_c_p_margin_group.html#a144b67f216e4e86c3a3a309e850285fe">clear</a>, or just delete the margin group.</p>
<h1><a class="anchor" id="QCPMarginGroup-example"></a>
Example</h1>
<p>First create a margin group: </p><div class="fragment"></div><!-- fragment --><p>Then set this group on the layout element sides: </p><div class="fragment"></div><!-- fragment --><p>Here, we've used the first two axis rects of the plot and synchronized their left margins with each other and their right margins with each other. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac481c20678ec5b305d6df330715f4b7b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac481c20678ec5b305d6df330715f4b7b">&#9670;&nbsp;</a></span>QCPMarginGroup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPMarginGroup::QCPMarginGroup </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_custom_plot.html">QCustomPlot</a> *&#160;</td>
          <td class="paramname"><em>parentPlot</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a new <a class="el" href="class_q_c_p_margin_group.html" title="A margin group allows synchronization of margin sides if working with multiple layout elements...">QCPMarginGroup</a> instance in <em>parentPlot</em>. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a144b67f216e4e86c3a3a309e850285fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a144b67f216e4e86c3a3a309e850285fe">&#9670;&nbsp;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPMarginGroup::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears this margin group. The synchronization of the margin sides that use this margin group is lifted and they will use their individual margin sizes again. </p>

</div>
</div>
<a id="ac967a4dc5fe02ae44aeb43511d5e1bd4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac967a4dc5fe02ae44aeb43511d5e1bd4">&#9670;&nbsp;</a></span>elements()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">QList&lt; <a class="el" href="class_q_c_p_layout_element.html">QCPLayoutElement</a> * &gt; QCPMarginGroup::elements </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespace_q_c_p.html#a7e487e3e2ccb62ab7771065bab7cae54">QCP::MarginSide</a>&#160;</td>
          <td class="paramname"><em>side</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns a list of all layout elements that have their margin <em>side</em> associated with this margin group. </p>

</div>
</div>
<a id="ae0d32656d8a5fc5690c4e7693f9d0539"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0d32656d8a5fc5690c4e7693f9d0539">&#9670;&nbsp;</a></span>isEmpty()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool QCPMarginGroup::isEmpty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns whether this margin group is empty. If this function returns true, no layout elements use this margin group to synchronize margin sides. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8h_source.html">qcustomplot.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8cpp.html">qcustomplot.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
